﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zeta.TreeSharp;
using Zeta.MemoryManagement;
using Zeta;

namespace IncubusCC.Composites
{
    public class FrameLockedComposite : Sequence
    {
        public FrameLockedComposite(ContextChangeHandler contextChange, params Composite[] children)
            : base(contextChange, children)
        {
        }

        public FrameLockedComposite(params Composite[] children)
            : base(children)
        {
        }

        protected override IEnumerable<RunStatus> Execute(object context)
        {
            using (FrameLock fl = ZetaDia.Memory.AcquireFrame())
            {
                return base.Execute(context);
            }
        }
    }
}
